﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tum.CollabXT
{
    /// <summary>
    /// Attribute for PET associations. Determines the type and direction of the association.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
    public class AssociationKindAttribute : Attribute
    {
        /// <summary>
        /// Type of the association.
        /// </summary>
        public AssociationType AssociationType { get; private set; }

        /// <summary>
        /// Direction of the association.
        /// </summary>
        public AssociationDirection AssociationDirection { get; private set; }

        /// <summary>
        /// Constructor.
        /// </summary>
        public AssociationKindAttribute(AssociationType type, AssociationDirection direction)
        {
            AssociationType = type;
            AssociationDirection = direction;
        }
    }

    /// <summary>
    /// Enumeration of association directions.
    /// </summary>
    public enum AssociationDirection
    {
        /// <summary>
        /// Directed association.
        /// </summary>
        Directed,

        /// <summary>
        /// Undirected, bidirectional association.
        /// </summary>
        Undirected,

        /// <summary>
        /// Reserved for future use.
        /// </summary>
        Miscellaneous,
    }

    /// <summary>
    /// Enumeration of association types.
    /// </summary>
    public enum AssociationType
    {
        /// <summary>
        /// Association is a general relation between process elements.
        /// </summary>
        Relation,

        /// <summary>
        /// Association describes a dependency, where the source element is dependent from the destination process element.
        /// This means e.g. that the source element must be checked for consistency when the destination element is modified.
        /// </summary>
        Dependency,

        /// <summary>
        /// Association describes that the source element is a part of the destination process element.
        /// </summary>
        Composition,

        /// <summary>
        /// Reserved for future use.
        /// </summary>
        Miscellaneous,
    }
}
